﻿Imports System.Data.SqlClient
Imports DTO


Public Class TheDocGia_DAO
    Public Shared Function getMaThe(ByVal tentk As String) As Integer
        Dim dt As New DataTable
        Dim con As SqlConnection = DataProvider.ConnectToDB
        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "TaiKhoan_GetMaThe"
        cmd.Connection = con

        Dim para As New SqlParameter("tentk", SqlDbType.NVarChar, 30)
        para.Direction = ParameterDirection.Input
        para.Value = tentk
        cmd.Parameters.Add(para)

        para = New SqlParameter("mathe", SqlDbType.Int)
        para.Direction = ParameterDirection.Output
        cmd.Parameters.Add(para)

        cmd.ExecuteNonQuery()

        con.Close()

        Return cmd.Parameters("mathe").Value

    End Function
End Class
